#include "myhelper.h"
#include<QTime>
#include<QCoreApplication>

MyHelper::MyHelper(QObject *parent) :
    QObject(parent)
{
}

void MyHelper::Sleep(int msec)
{
    QTime dieTime = QTime::currentTime().addMSecs(msec);
    while ( QTime::currentTime() < dieTime ) {
        QCoreApplication::processEvents(QEventLoop::AllEvents, 100);//ExcludeUserInputEvents AllEvents

    }
}
